{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import sklearn\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# Some functions to plot our points and draw the models\n",
    "def plot_points(features, labels):\n",
    "    X = np.array(features)\n",
    "    y = np.array(labels)\n",
    "    spam = X[np.argwhere(y==1)]\n",
    "    ham = X[np.argwhere(y==0)]\n",
    "    plt.scatter([s[0][0] for s in spam],\n",
    "                [s[0][1] for s in spam],\n",
    "                s = 25,\n",
    "                color = 'cyan',\n",
    "                edgecolor = 'k',\n",
    "                marker = '^')\n",
    "    plt.scatter([s[0][0] for s in ham],\n",
    "                [s[0][1] for s in ham],\n",
    "                s = 25,\n",
    "                color = 'red',\n",
    "                edgecolor = 'k',\n",
    "                marker = 's')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Building a linear dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD4CAYAAADxeG0DAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAVPUlEQVR4nO3dfYxcV3nH8d+zIbyE7BJbWYmUxLWjbAwLAnu9slq1qigvrUuw17Syg+mLqP+w+AMVBJYNjcDjJkhtkFClUiQSBZVKUZxVAp5ZrxEkairKHwH2JdBk14ucAMI0kKWOY1uIIsdP/5jZzb7M7s7OvXfuPed+P9JInvHuvefuzj73zHOec465uwAA4erKuwEAgGQI5AAQOAI5AASOQA4AgSOQA0DgXpXHSW+88UbfvHlzHqcGgGCNj4//yt17l76eSyDfvHmzxsbG8jg1AATLzH7a7HVSKwAQOAI5AASOQA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tf+qCk05KOZdicVKx1TWb2YUnvl/RuD2DQYh2/o5D9XNItC57f3HgNBdLIJT8q6UF3/1re7UmLu18wsyck7ZK05uB04XrkqzGzvgVPhySdyastaTGzXZKOSNrj7r/Ouz2Y931JfWa2xcxeLemDkmo5twkLNAYHH5A07e5fyLs9SZlZ71zVmpm9TvWB9pZiXGhVK49K2qp6VcRPJX3E3YPuJZnZWUmvkfS/jZeeDLkSx8w+IOlfJPVKuiDpKXf/03xb1R4ze5+kf5Z0jaSvuPvncm5SImb2kKR3qr5E6i8lHXP3B3JtVAJm9oeS/kvSf6seEyTp7939dH6tap+ZvV3SV1V/v3VJGnb3f2jpe0MK5ACA5YJKrQAAliOQA0DgCOQAEDgCOQAEjkAOAIEjkANA4AjkABC4/wcOIHNqJkt5owAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "rows = []\n",
    "\n",
    "import random\n",
    "\n",
    "#Adding points\n",
    "for i in range(50):\n",
    "    x = 6*random.random()-3\n",
    "    y = 6*random.random()-3\n",
    "    z = int(x+y > 0.5)\n",
    "    rows.append([x,y,z])\n",
    "\n",
    "#Adding noise\n",
    "for i in range(10):\n",
    "    x = 6*random.random()-3\n",
    "    y = 6*random.random()-3\n",
    "    z = random.randint(0,1)\n",
    "    rows.append([x,y,z])\n",
    "    \n",
    "df_linear = pd.DataFrame(rows, columns=['x_1', 'x_2', 'y'])\n",
    "\n",
    "plot_points(df_linear[['x_1', 'x_2']], df_linear['y'])\n",
    "\n",
    "df_linear.to_csv('./linear.csv')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Building a circular dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD4CAYAAADxeG0DAAAABHNCSVQ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3ALjFzGZJ1gDMANgX49+GJAG808zmSd4A4NsAPmdmz2bddjQZ+XIQX/JOYM0zVKNhZk+a2dWlL58FcJvP9mRlZnNmdt53OzK4G8AFM3vZzH4BYBSLjy6Mkpl9C8Abvtvhgpm9amazS/++AmAOwK1+W5WOLZpf+vKGpZeTOBZNIAcAko+Q/CGA3wNw2Hd7HDkA4F98N6LibgXwwxVfX0SkwaLMSG4DsAvAc35bkh7JTSTPAHgdwFNm5uRYggrkJJ8m+b0mr70AYGYPmtntAE4A+Kzf1m6s1bEs/cyDAK5i8XiC1s7xiOSF5I0AHgfwpw1351Exs7fMbCcW78LvJumk6yvrw5edMrOPtPmjJwBMATiSY3MyaXUsJD8N4OMAPmwRDFR08LeJ0Y8A3L7i69uW3pMALPUnPw7ghJl9w3d7XDCzn5B8BsAeAJkHpYPKyDdCcseKL/cCOOerLVmR3APgAQBDZvZT3+0RPA9gB8k+km8H8CkAdc9tElwbIPwKgDkz+7Lv9mRBsne5Qo3kO7A4uO4kjsVUtfI4gPdhsTriFQCfMbMosyaSFwD8EoD/WXrr2VgrcACA5CcA/C2AXgA/AXDGzH7Hb6s6Q/JjAP4awCYAj5rZI56blBrJrwH4TSwulfrfAI6Y2Ve8Niolkr8O4D8A/BcWr30A+Aszm/LXqnRI3gXgn7F4jnUBeMzM/tLJtmMJ5CIi0lw0XSsiItKcArmISOQUyEVEIqdALiISOQVyEZHIKZCLiEROgVxEJHL/D9PdsW7RyJ6hAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "rows = []\n",
    "\n",
    "import random\n",
    "\n",
    "#Adding points\n",
    "for i in range(100):\n",
    "    x = 6*random.random()-3\n",
    "    y = 6*random.random()-3\n",
    "    z = int((x)**2+y**2 < 2.8)\n",
    "    rows.append([x,y,z])\n",
    "\n",
    "#Adding noise\n",
    "for i in range(10):\n",
    "    x = 6*random.random()-3\n",
    "    y = 6*random.random()-3\n",
    "    z = random.randint(0,1)\n",
    "    rows.append([x,y,z])\n",
    "\n",
    "    \n",
    "df_one_circle = pd.DataFrame(rows, columns=['x_1', 'x_2', 'y'])\n",
    "\n",
    "plot_points(df_one_circle[['x_1', 'x_2']], df_one_circle['y'])\n",
    "\n",
    "df_one_circle.to_csv('./one_circle.csv')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Building a two-circles dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD4CAYAAADxeG0DAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nO3dbYxc1XkH8P+z2NTY7OLdYCluwPWuYqO4CBl75TZqFTVvLYLEJiGEuE2qyKnctE2aCIw3Buwdg5B4iUir5AOGBimREGsUwDtrO2pApS9IIcFrExrbCzVITkggmNrUu4oUvLtPP8zMenbmzsx9Offec879/6QR7Hp27rkv89xzz3nOOaKqICIid3XlXQAiIkqGgZyIyHEM5EREjmMgJyJyHAM5EZHjFuSx0UsvvVRXrlyZx6aJiJw1Pj7+tqoua/x9LoF85cqVOHToUB6bJiJyloicDPo9m1aIiBzHQE5E5DgGciIixzGQExE5joGciMhxiQO5iCwSkZ+KyM9E5KiI7DZRMCIiCsdE+uHvAHxEVadEZCGA50Tkh6r6vIHPJiKiDhIHcq3MgztV/XFh9cW5cYmIMmKkjVxELhCRFwG8BeBpVf1JwHu2isghETl06tQpE5slCk1VMTIyAs6/TwDQ19MDEZn36uvpybtYsRkJ5Ko6o6prAVwGYIOIXBnwnodUdVBVB5ctaxphmoiNJ8XGMhVZuVzG5s2bMTY2lndRy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sUjIlcB+B4q11gXgMdV9c7En+taICciovmca1ohIqL5GMiJiBzHQE5E5DgGciIixzGQExE5joGciMhxDORERI77f106080820e5AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "rows = []\n",
    "\n",
    "import random\n",
    "\n",
    "#Adding points\n",
    "for i in range(200):\n",
    "    x = 6*random.random()-3\n",
    "    y = 6*random.random()-3\n",
    "    z = int(((x-1)**2+y**2 < 2) or ((x+1)**2+y**2 < 2))\n",
    "    rows.append([x,y,z])\n",
    "\n",
    "#Adding noise\n",
    "for i in range(20):\n",
    "    x = 6*random.random()-3\n",
    "    y = 6*random.random()-3\n",
    "    z = random.randint(0,1)\n",
    "    rows.append([x,y,z])\n",
    "\n",
    "    \n",
    "df_two_circles = pd.DataFrame(rows, columns=['x_1', 'x_2', 'y'])\n",
    "\n",
    "plot_points(df_two_circles[['x_1', 'x_2']], df_two_circles['y'])\n",
    "\n",
    "df_two_circles.to_csv('./two_circles.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD4CAYAAADxeG0DAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2df5Bd5Xnfv88iwUpo114FeRAYVZLRaiyMLQn517S0aaENUyxk1QNCTpzESkZN27hOLQYFXLSXdpyhUSbTmeaPFsaM3RkqQTDaXQl5bDO1kuIJxJKAmLWEgzx2gAojW4CkhgR29+kf997l7t1z9p4f7znv+5zz/czcgbu6957nvOc9z/uc59crqgpCCCF26fMtACGEkH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pyJYCXOt6/DINKo6qIyEoAGwA87VeSbIjIRSLyLIDXAHxHVZ2fR9CK3NXGz77pdR6tz3wZwCSa5xIsSc7FIBLxN5NPeFVDRJYA+AaA3+t6CjeDqk6p6no0n7Y/JiLOXV55t3orlKps/NzrPETkNwB8CsANGnjQIsU1scTLAK7qeP9+AP/XkyykRcun/A0AD6nqY77lyYuqviEiRwDcBMBpMDpoi3w+qrLxs4jcBGA3gFtU9W99y1NTvg9gjYisEpGLAdwOYNyzTLWmFST8KoATqvrHvuXJiogsa2eiicgiADeiAF1lOWvlGwBmbfysqq/4lSo9IvIigEsA/KL1p6csZt8AgIhsBfDfACwD8AaAZ1X1V/xKlQwR+ZcA/iuAiwA8qKpf8SxSJkRkH4BfRrNt6s8AjKjqV70KlQER+UcA/g+AH6B5jwPA3ap62J9U6RGRDwP4Oprzqg/AI6r6n5wfx6oiJ4QQ0sSsa4UQQkgTKnJCCDEOFTkhhBiHipwQQoxDRU4IIcahIieEEONQkRNCiHH+P+siwTj9wy3fAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "rows = []\n",
    "\n",
    "import random\n",
    "\n",
    "#Adding points\n",
    "for i in range(200):\n",
    "    x = 6*random.random()-3\n",
    "    y = 6*random.random()-3\n",
    "    z = int(((x-1)**2+y**2 < 2) or ((x+1)**2+y**2 < 2))\n",
    "    rows.append([x,y,z])\n",
    "\n",
    "#Adding noise\n",
    "for i in range(20):\n",
    "    x = 6*random.random()-3\n",
    "    y = 6*random.random()-3\n",
    "    z = random.randint(0,1)\n",
    "    rows.append([x,y,z])\n",
    "\n",
    "    \n",
    "df_two_circles = pd.DataFrame(rows, columns=['x_1', 'x_2', 'y'])\n",
    "\n",
    "plot_points(df_two_circles[['x_1', 'x_2']], df_two_circles['y'])\n",
    "\n",
    "#df_two_circles.to_csv('./two_circles_zapata.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_two_circles.to_csv('./two_circles_zapata.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
